/*
 * RealAccount.java
 * 
 * Created on 19-jun-2007, 20:51:30
 * 
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.i2a.peacsy.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Tortuga
 */
@Entity
@Table(name = "TA_REAL_REAL_ACCOUNTS")
@NamedQueries({@NamedQuery(name = "RealAccount.findBySharCoCode", query = "SELECT r FROM RealAccount r WHERE r.sharCoCode = :sharCoCode"), @NamedQuery(name = "RealAccount.findByRealLiBankId", query = "SELECT r FROM RealAccount r WHERE r.realLiBankId = :realLiBankId"), @NamedQuery(name = "RealAccount.findByRealLiBranchId", query = "SELECT r FROM RealAccount r WHERE r.realLiBranchId = :realLiBranchId"), @NamedQuery(name = "RealAccount.findByRealLiControl", query = "SELECT r FROM RealAccount r WHERE r.realLiControl = :realLiControl"), @NamedQuery(name = "RealAccount.findByRealLiAccountNumber", query = "SELECT r FROM RealAccount r WHERE r.realLiAccountNumber = :realLiAccountNumber"), @NamedQuery(name = "RealAccount.findByRealLiInternationalId", query = "SELECT r FROM RealAccount r WHERE r.realLiInternationalId = :realLiInternationalId")})
public class RealAccount implements Serializable {

  @Id
  @Column(name = "SHAR_CO_CODE", nullable = false)
  private Integer sharCoCode;

  @Column(name = "REAL_LI_BANK_ID")
  private String realLiBankId;

  @Column(name = "REAL_LI_BRANCH_ID")
  private String realLiBranchId;

  @Column(name = "REAL_LI_CONTROL")
  private String realLiControl;

  @Column(name = "REAL_LI_ACCOUNT_NUMBER")
  private String realLiAccountNumber;

  @Column(name = "REAL_LI_INTERNATIONAL_ID")
  private String realLiInternationalId;
    protected static org.apache.commons.logging.Log
        log = org.apache.commons.logging.LogFactory.getLog(RealAccount.class);

    public RealAccount() {
    }

  public RealAccount(Integer sharCoCode) {
    this.sharCoCode = sharCoCode;
  }

  public Integer getSharCoCode() {
    return sharCoCode;
  }

  public void setSharCoCode(Integer sharCoCode) {
    this.sharCoCode = sharCoCode;
  }

  public String getRealLiBankId() {
    return realLiBankId;
  }

  public void setRealLiBankId(String realLiBankId) {
    this.realLiBankId = realLiBankId;
  }

  public String getRealLiBranchId() {
    return realLiBranchId;
  }

  public void setRealLiBranchId(String realLiBranchId) {
    this.realLiBranchId = realLiBranchId;
  }

  public String getRealLiControl() {
    return realLiControl;
  }

  public void setRealLiControl(String realLiControl) {
    this.realLiControl = realLiControl;
  }

  public String getRealLiAccountNumber() {
    return realLiAccountNumber;
  }

  public void setRealLiAccountNumber(String realLiAccountNumber) {
    this.realLiAccountNumber = realLiAccountNumber;
  }

  public String getRealLiInternationalId() {
    return realLiInternationalId;
  }

  public void setRealLiInternationalId(String realLiInternationalId) {
    this.realLiInternationalId = realLiInternationalId;
  }

  @Override
  public int hashCode() {
    int hash = 0;
    hash += (sharCoCode != null ? sharCoCode.hashCode() : 0);
    return hash;
  }

  @Override
  public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof RealAccount)) {
      return false;
    }
    RealAccount other = (RealAccount) object;
    if (this.sharCoCode != other.sharCoCode && (this.sharCoCode == null || !this.sharCoCode.equals(other.sharCoCode))) {
      return false;
    }
    return true;
  }

  @Override
  public String toString() {
    return "org.i2a.peacsy.entity.RealAccount[sharCoCode=" + sharCoCode + "]";
  }

}
